﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Xml.Linq;

using ProjectBase.Core;

namespace ProjectBase.Tools.Publishing
{
    [ContractClass(typeof(Diagnostics.PublishingHandler))]
    public interface IPublishingHandler
    {
        void Init(XElement settings);
        void Exit();

        PublishingResult Handle(object reporter, string message, Exception exception);
        PublishingResult Handle(object reporter, Severity severity, object message, params object[] args);
        PublishingResult Handle(object reporter, Func<string> message, Severity severity);

        void SetSuccessor(IPublishingHandler successor);

        int Priority { get; set; }
        IPublishingHandler Successor { get; }
    }
}